package com.example.checkqufuface.Customer;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.checkqufuface.Adapter.ticketImforMessageShowAdapter;
import com.example.checkqufuface.R;
import com.example.checkqufuface.bean.QufuQueryAppOrderDetailResultBean;

import java.util.Map;

public class BottomTicketDetailDialog extends BottomDialogBase implements View.OnClickListener {

    private Context context;
    private ImageView close;
    private RecyclerView rvShow;
    private QufuQueryAppOrderDetailResultBean.DataBean dataBean;
    private String BaseUrl;
    private Map<String, String> headers;
    private TextView tvId;
    private TextView tvNumber;
    private TextView tvMoney;
    private TextView tvStatue;
    private TextView tvName;
    private TextView tvPhone;
    private TextView tvTime;

    public BottomTicketDetailDialog(Context context, final String baseUrl, final Map<String, String> headers, QufuQueryAppOrderDetailResultBean.DataBean data) {
        super(context);
        this.context = context;
        this.BaseUrl = BaseUrl;
        this.headers = headers;
        this.dataBean = dataBean;

        tvId.setText(data.getOrderDetailId() + "");
        tvNumber.setText(data.getSaleSum() + "");
        tvMoney.setText(data.getSaleSum() + "");
        tvStatue.setText(data.getSaleAmount() + "");
        tvName.setText(data.getTackUserName() + "");
        tvPhone.setText(data.getTackPhoneNumber() + "");
        tvTime.setText(data.getCreatedDate() + "");


        ticketImforMessageShowAdapter messageShowAdapter = new ticketImforMessageShowAdapter(context, data.getAppOrderDetailResultList(),baseUrl,headers);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
        rvShow.setLayoutManager(linearLayoutManager);
        rvShow.setAdapter(messageShowAdapter);


        close.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

    @Override
    protected void onCreate() {
        setContentView(R.layout.widget_make_ticket_datail);

        tvId = findViewById(R.id.tv_ticket_detail_id);
        tvNumber = findViewById(R.id.tv_ticket_detail_number);
        tvMoney = findViewById(R.id.tv_ticket_detail_money);
        tvStatue = findViewById(R.id.tv_ticket_detail_statue);
        tvName = findViewById(R.id.tv_ticket_detail_name);
        tvPhone = findViewById(R.id.tv_ticket_detail_phone);
        tvTime = findViewById(R.id.tv_ticket_detail_time);

        rvShow = findViewById(R.id.tv_ticket_message_show);
        close = findViewById(R.id.iv_wg_qu_xiao_ka);
    }

    @Override
    public void onClick(View v) {
        dismiss();
    }

}


